package homework;

import java.math.BigDecimal;

public class Test04 {
    public static void main(String[] args) {
        //随机生成100内小数
        double num = Math.random()*100;
        System.out.println("随机数为："+num);
        //转换
        System.out.println("转换为："+new BigDecimal(num).setScale(2,1));
    }
}
